//
//  SupplicationViewController.m
//  ZiJinLian
//
//  Created by 🐛 on 2017/4/13.
//  Copyright © 2017年 lzy. All rights reserved.
//

#import "SupplicationViewController.h"
#import "RewardViewController.h"
#import "RewardWallViewController.h"
#import "VowViewController.h"
#import "MyWishViewController.h"
@interface SupplicationViewController ()
@property(nonatomic,strong) NSMutableArray *imgeArray;
@property(nonatomic,strong) UIImageView *imge;
@property(nonatomic,assign) int index;
@end

@implementation SupplicationViewController
-(NSMutableArray *)imgeArray{
    if (!_imgeArray) {
        _imgeArray=[[NSMutableArray  alloc]initWithObjects:@"阿弥陀佛",@"白度母",@"大白伞",@"黄财神",@"金刚萨埵",@"释迦牟尼",@"四臂观音",@"文殊菩萨",@"药师佛",@"尊胜佛母", nil];
    }
    return _imgeArray;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self loadRequest];
 //   self.index=0;
//    UIButton *btn=[[UIButton alloc]initWithFrame:CGRectMake(0, 0, 30, 44)];
//    [btn setTitle:@"切换" forState:0];
//    [btn setTitleColor:[UIColor whiteColor] forState:0];
//    btn.titleLabel.font=[UIFont systemFontOfSize:14];
//    [btn addTarget:self action:@selector(editorBtnClick) forControlEvents:UIControlEventTouchUpInside];
//    UIBarButtonItem*item=[[UIBarButtonItem alloc] initWithCustomView:btn];
//    [self.navigationItem setRightBarButtonItem:item];
    // Do any additional setup after loading the view.
}
-(void)editorBtnClick{
//    if (self.index==self.imgeArray.count-1) {
//        self.index=0;
//    }else{
//        self.index++;
//    }
//    self.imge.image=[UIImage imageNamed:self.imgeArray[self.index]];
}
-(void)createView{
    self.title=MyString(@"祈愿");
    UIImageView*imag=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, MainW, MainH-64-50)];
    imag.image=[UIImage imageNamed:@"image_pray"];
    [self.view addSubview:imag];
    self.imge=imag;
    UIButton *wishBtn=[[UIButton alloc]initWithFrame:CGRectMake(0, MainH-50-64, MainW/2, 50)];
    [wishBtn setTitle:MyString(@"我的心愿") forState:UIControlStateNormal];
    [wishBtn addTarget:self action:@selector(wishBtnClick) forControlEvents:UIControlEventTouchUpInside];
    wishBtn.backgroundColor=HJ_Color(203, 9, 20);
    [self.view addSubview:wishBtn];
    UIButton *wishWallBtn=[[UIButton alloc]initWithFrame:CGRectMake(MainW/2, MainH-50-64, MainW/2, 50)];
    [wishWallBtn setTitle:MyString(@"心愿墙") forState:UIControlStateNormal];
    [wishWallBtn addTarget:self action:@selector(wishWallBtnBtnClick) forControlEvents:UIControlEventTouchUpInside];
    wishWallBtn.backgroundColor=HJ_Color(226, 83, 29);
    [self.view addSubview:wishWallBtn];
	
}

//我的心愿
-(void)wishBtnClick{
    MyWishViewController*vc=[[MyWishViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
    vc.popWhere=2;
    vc.title=MyString(@"我的心愿");
}
//心愿墙
-(void)wishWallBtnBtnClick{
    RewardWallViewController*vc=[[RewardWallViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
    vc.title=MyString(@"心愿墙");

}
-(void)loadRequest{
    NSMutableDictionary*dic=[NSMutableDictionary dictionary];
    dic[@"userId"]=[ZJUserDefaultsTools getCurrentUserID];
    [self doHttpRequestWithApi:@"/api/pray/search/prayimgurl" method:GET dic:dic successBlock:^(NSDictionary *dic) {
        
    }];
}

@end
